package com.example.sneakerappserver.pojo;

import jakarta.persistence.*;
import lombok.Getter;

@Table(name ="tb_order")
@Entity
public class Order {
    @Getter
    @Id
    @Column(name = "order_id")
    private long orderId;

    public Order() {

    }

//    @ManyToOne // 表示多对一关系
//    @JoinColumn(name = "user_id", referencedColumnName = "user_id") // 外键列名为 user_id
//    private User user;   // // 映射到 User 实体
    @Column(name = "user_id")
    private long userId;


    @Getter
    private String status; // 订单状态 （待支付pay、已支付paid、已发货deliver、已完成、已取消等）
    @Getter
    @Column(name = "total_amount")
    private double totalAmount; // 总金额
    @Getter
    @Column(name = "created_at")
    private String createdAt; // 下单时间
    @Getter
    private String address; // 收获地址
    @Getter
    @Column(name = "payment_status")
    private String paymentStatus;   // 支付状态 （待支付pay、已支付paid、发货deliver等）


    public void setOrderId(long orderId) {
        this.orderId = orderId;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public void setTotalAmount(double totalAmount) {
        this.totalAmount = totalAmount;
    }

    public void setCreatedAt(String createdAt) {
        this.createdAt = createdAt;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public void setPaymentStatus(String paymentStatus) {
        this.paymentStatus = paymentStatus;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }
}
